<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
<title><?php echo ($site_title); ?></title>
<meta name="keywords" content="<?php echo ($site_keywords); ?>" />
<meta name="description" content="<?php echo ($site_description); ?>">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="author" content="361dream">
 <?php echo hook('syncMeta');?>
<link href="http://cdn.amazeui.org/amazeui/2.4.2/css/amazeui.min.css" rel="stylesheet">

<link href="/ke361/Public/Home/css/nayiya.css" rel="stylesheet">
<link href="/ke361/Public/Home/images/favicon.ico" rel="icon" type="image/x-icon" />


	<style type="text/css">
		body{
			background-color: #fff;
		}
		.am-container{
			max-width:1200px;
		}
	</style>

   
    
</head>
<body>

	<!--[if lte IE 9 ]><div class="am-alert am-alert-danger ie-warning" data-am-alert>
	<button type="button" class="am-close">&times;</button>
	<div class="am-container">
		咿呀提醒：你的浏览器太古董了，咿呀无爱，<a
			href="http://browsehappy.com/" target="_blank">速速点击换一个</a>！</div></div><![endif]-->
<!-- 页头 -->
<header class="am-topbar">
	<h1 class="am-topbar-brand">
		<a id="header_logo" class="navbar-brand" href="/" title="<?php echo C('WEB_SITE_TITLE');?>" style="background-image:url('/ke361/Public/Home/images/<?php echo C('WEB_SITE_LOGO');?>')"></a>
	</h1>
    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
    <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav">
	             <li >
	                   <a id="nav-00"  href="<?php echo U('Index/index');?>" target="_self">首页</a>
	             </li>	
				 <?php $__NAV__ = M('Channel')->field(true)->where("status=1")->order("sort")->select(); if(is_array($__NAV__)): $i = 0; $__LIST__ = $__NAV__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i; if(($nav["pid"]) == "0"): ?><li >
	                            <a id="nav-<?php echo ($nav["id"]); ?>"  href="<?php echo (get_nav_url($nav["url"])); ?>" target="<?php if(($nav["target"]) == "1"): ?>_blank<?php else: ?>_self<?php endif; ?>"><?php echo ($nav["title"]); ?></a>
	                        </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                  <?php if($config["SHOW_GOODS_CATEGORY"] == '1' ): if(!empty($category_goods_tree)): ?><li class="am-dropdown" data-am-dropdown>
			          <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">商城 <span class="am-icon-caret-down"></span></a>
			          <ul class="am-dropdown-content">
			          	<?php if(is_array($category_goods_tree)): $i = 0; $__LIST__ = $category_goods_tree;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U('Goods/cate?id='.$vo['id']);?>"><?php echo ($vo['category_name']); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
			          </ul>
			       </li><?php endif; endif; ?>
	         </ul>

	        <form class="am-topbar-form am-topbar-left am-form-inline" role="search" action="<?php echo U('Search/index');?>" method="POST">
		        <div class="am-form-group">
		         	 <input type="text" name="keywords" id="keywords" class="am-form-field am-input-sm" value="<?php echo ($keyword); ?>" placeholder="请输入想找的宝贝...">
		        </div>
                <button type="submit" class="am-btn am-btn-primary">搜索</button>
		    </form>
            <div class="am-topbar-right">
                <?php if($my['uid'] > 0): ?><li class="am-dropdown" data-am-dropdown>
			          <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;"><?php echo ($my['username']); ?> <span class="am-icon-caret-down"></span></a>
			          <ul class="am-dropdown-content">	
			          		<li><a  href="<?php echo U('User/index');?>">个人主页</a></li>		       
			          		<li><a class="ajax-get" href="<?php echo U('User/logout');?>">退出</a></li>			          	
			          		
			          </ul>
			    </li>
                <?php else: ?>
                    <a class="am-btn am-btn-primary am-topbar-btn am-btn-sm" href="<?php echo U('User/login');?>" rel="nofollow">登录</a>
                    <a class="am-btn am-btn-primary am-topbar-btn am-btn-sm" href="<?php echo U('User/register');?>" rel="nofollow">注册</a><?php endif; ?>

            </div>
		</div>
	</nav>
</header>   
<!-- /页头 -->

	

	
	
	
	<div class="am-container" >
        
		<?php if(!empty($category)): ?><div class="row category-box">
		<div class="col-sm-1">

		</div>
		<div class="col-sm-11 category-item">
			
			<?php if(is_array($children_tree)): $i = 0; $__LIST__ = $children_tree;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if($vo["pid"] != 0): ?><a class="child" href="<?php echo U('/category/'.$vo['id']);?>"><?php echo ($vo["title"]); ?></a>
				<?php else: ?>
					<a class="parent" href="<?php echo U('/category/'.$vo['id']);?>">全部</a><?php endif; endforeach; endif; else: echo "" ;endif; ?>
		</div>
		
	</div>
	<script type="text/javascript">
	
		 
	</script><?php endif; ?>
		
        <div class="am-g">
			<div data-am-widget="list_news" class="article-list am-list-news am-list-news-default" >
				<div class="am-list-news-bd">
					<ul class="am-list" id="content-list">
						<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li class="am-g">
								<div class="am-list-thumb ">
									<a href="<?php echo U('/article/'.$vo['id']);?>" class="">
										<img class="am-img-responsive lazy" data-original="<?php echo (get_cover($vo["cover_id"],path)); ?>" src="/ke361/Public/Home/images/s.jpg" alt="<?php echo ($vo["title"]); ?>"/>
									</a>
								</div>
								<div class="am-list-main">
									<h3 class="am-list-item-hd article-title"><a href="<?php echo U('/article/'.$vo['id']);?>" class=""><?php echo ($vo["title"]); ?></a></h3>

									<div class="am-list-item-text article-disc"><?php echo ($vo["description"]); ?></div>

								</div>
								<div class="view-info">
									<ul class="post-info">
										<li class="info-item">
											<i class="am-icon-eye"></i>
											<span><?php echo ($vo["view"]); ?></span>
										</li>
										<li class="info-item">
											<i class="am-icon-heart-o" data-id="<?php echo ($vo["id"]); ?>"></i>
											<span><?php echo ($vo["favor"]); ?></span>
										</li>

										<li class="info-item">
											<i class="am-icon-comment-o"></i>
											<span><?php echo ($vo["comment"]); ?></span>
										</li>
									</ul>

								</div>
							</li><?php endforeach; endif; else: echo "" ;endif; ?>
					</ul>
				</div>

			</div>
		</div>

			<button id="next" class="hidden btn-get-more" data-url="<?php echo ($next_page); ?>">
				点击加载更多
			</button>

    </div>

	
	
	
	<!-- 页脚 -->


<div class="cart am-gotop-fixed">
    <a id="cart" href="<?php echo U('Cart/cart');?>" title="购物车">
        <span class="am-gotop-title">购物车</span>
        <i class="am-gotop-icon am-icon-shopping-cart"></i>
    </a>
    <span class="am-badge am-badge-primary am-round cart-number">0</span>
</div>
<div data-am-widget="gotop" class="am-gotop am-gotop-fixed" >
    <a href="#top" title="回到顶部">
        <span class="am-gotop-title">回到顶部</span>
        <i class="am-gotop-icon am-icon-chevron-up"></i>
    </a>
</div>
<!-- 信息提示框 -->
<div id="top-alert" class="am-fixed am-alert am-alert-danger" style="display: none;">
    <button class="am-close">&times;</button>
    <div class="am-alert-content">这是内容</div>
</div>
<div id="message" class="am-fixed am-message " style="display:none ;">
    <button class="am-close">&times;</button>
    <div class="am-alert-content">这是内容</div>
</div>
<footer class="am-footer ">

    <div class="row copyright">

        <span ><?php echo C('WEB_SITE_ICP');?></span><span>Copyright© 2014-2015 Powered by <a href="http://www.361dream.com">Ke361</a></span>
    </div>

</footer>
<?php echo C('TONGJI');?>
	
	
	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.4.2/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<!--<![endif]-->
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.min.js"></script>
<script src="/ke361/Public/static/jquery.lazyload.min.js"></script>
<script>
    var haveData                    =   true;
	$(function(){
 		$('.article-list>ul>li').hover(
				function(){
					$(this).css('box-shadow','0px 2px 8px 3px #ccc');
				},
				function(){
					$(this).css('box-shadow','');
				}
			
		);
		$('.goods-list .item').hover(
				function () {
					$(this).addClass('hover');
				}, function () {
					$(this).removeClass('hover');
				}
		);
		$('.like').hover(
				function () {
					$(this).find('i').removeClass('am-icon-heart-o').addClass('am-icon-heart');
				}, function () {
					$(this).find('i').removeClass('am-icon-heart').addClass('am-icon-heart-o');
				}
		);
 		$('#go-top').click(function(){
 			$('html, body').animate({scrollTop:0}, 'slow');
 			$('.side_right .con').hide();
 			return false;
 		}); 
 		$(window).scroll(function () {
 			if ($(window).scrollTop() > 500) {
 				$('.side_right .go-top').show();
 			}else{
 				$('.side_right .go-top').hide();
 			}


            if ($(window).scrollTop() == $(document).height() - $(window).height()) {
                nextPage();
            }
 		});
 		$('.icon-like').click(function(){
 			 id = $(this).attr('data-id');
 			 that = $(this);
 			 $.get("<?php echo U('Article/favor');?>",{'id':id},function(json){
 	            showmsg(json.info);
 	            if(json.status == 1){
 	            	that.addClass('like');	
 	            }else{
 	            	that.removeClass('like');	
 	            }
 	  	  	});  
 		});
 		$('.lazy').lazyload( {
			effect : "fadeIn",
		    failure_limit : 12 
		});
	});

	function favor(goodsid){
		$.get("<?php echo U('ajax/favor');?>",{id:goodsid},function(json){
				showmsg(json.info);
		})
	}

	function updateCart(){
		target = "<?php echo U('Cart/updateCart');?>";
		$.post(target).success(function(data){
			if(data.errno == 0){
				$('.cart-number').html(data.count);
			}
		});
	}
	function setCookie(name,value)
	{
		var Days = 30;
		var exp = new Date();
		exp.setTime(exp.getTime() + Days*24*60*60*1000);
		document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
	function getCookie(name)
	{
		var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
		if(arr=document.cookie.match(reg))
			return unescape(arr[2]);
		else
			return null;
	}
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script><script src="/ke361/Public/Home/js/nayiya.js"></script>

<script>
	 $(function(){   

		  highlight_subnav("<?php echo U('Article/index',array('category'=>$top_category['id']));?>");
		  $('.category-item').find('a[href="'+'<?php echo ($url); ?>'+'"]').addClass('active');  

	});
	 function response() {
         $('.lazy').lazyload( {
             effect : "fadeIn",
             failure_limit : 12
         });
     }
	</script>	 






</body>
</html>